<template>
    <div class="edituserpage">
      <div class="header">
      <van-row>
        <van-col span=12 class="icons">
          <svg @click="goback" width="10.000000" height="16.000000" viewBox="0 0 10 16" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
          <path id="Vector" d="M3.63574 8L10 14.2227L8.18213 16L0 8L8.18213 0L10 1.77734L3.63574 8Z" fill-rule="evenodd" fill="#06070D"/>
        </svg>
        </van-col>
      </van-row>
      </div>
      <div class="cgform">
      <h3 class="fullname">探寻博览群书之门</h3>
      <p>没有找到想要的？提交申请</p>
      <div class="content">
        <span>请输入书名</span>
        <input type="text" v-model="bookname" placeholder="-"/>
      </div>

      <div class="content">
        <span>请输入作者</span>
        <input type="text" v-model="bookauthor" placeholder="-"/>
      </div>

      <div class="buybtn" @click="addBookClick">
      提交
    </div>
      </div>
    </div>
  </template>

<script>
import { Toast } from 'vant'
import { reqBook } from '@/api/api.js'
export default {
  name: 'Home',
  data () {
    return {
      bookname: '',
      bookauthor: ''
    }
  },
  methods: {
    goback () {
      this.$router.push('/user')
    },
    addBookClick () {
      const obj = {
        req_book: this.bookname,
        req_author: this.bookauthor
      }
      reqBook(obj).then((res) => {
        if (res.code === 200) {
          Toast.success('提交成功,待审核')
        } else {
          Toast.success('提交失败')
        }
      })
    }
  },
  mounted () {
  }
}
</script>
  <style lang="less" scoped>
  .edituserpage{
    padding: 0px 30px;
    width: calc(100% - 60px);
    background: #fdfdfd;
    height: calc(100% - 100px);
    overflow: auto;
  }
  .header{
    height: 60px;
    .icons{
      height: 60px;
      display: flex;
      // justify-content: center;
      align-items: flex-end;
    }
    .rig{
      justify-content: flex-end;
      svg{
        margin: 0px 20px;
      }
    }
  }
  .bookView{
    text-align: center;
    margin: 20px 0px;
    img {
      margin-bottom: 20px;
      width: 211px;
      height: 310px;
      box-shadow: -1px 16px 9px 5px #eee;
    }
    h4{
        margin-bottom: 20px;
    }
    .rate{
      display: block;
      margin-bottom: 20px;
    }
    .intro{
      text-indent: 40px;
      color: #a4a5a7;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
    }
    .allintro{
      text-indent: 40px;
      color: #a4a5a7;
    }
  }
  .fotbtn {
    margin-bottom: 10px;
    height: 40px;
    .infobtn{
      height: 40px;
      background: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 10px;
      box-shadow: 0px 0px 6px 0px #eeeeee;
      svg {
        margin: 0px 10px;
      }
    }
  }
  .buybtn{
    text-align: center;
    color: white;
    height: 60px;
    line-height: 60px;
    font-size: 20px;
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translate(-50%,0px);
    width: 90%;
    border-radius: 10px;
    background: #06070d;
  }
  .avater{
  text-align: center;
  padding-top: 50px;
  position: relative;
  margin: 0 auto;
  .avaterimg{
    width: 120px;
    height: 120px;
    border-radius: 50%;
    // border: 1px solid;
    overflow: hidden;
  }
  .changeicon{
    position: absolute;
    bottom: 0;
    left: 20%;
    transform: translate(-50%, 0);
    background: #000;
    border-radius: 50%;
    padding: 5px;
    border: 5px solid #ffffff;
  }
}
.cgform{
    width: 100%;
    text-align: center;
    .fullname{
      margin: 10px 0px;
    }
    .content{
      width: 100%;
      height: 50px;
      border: 1px solid #eee;
      border-radius: 15px;
      margin-bottom: 20px;
      display: flex;
      flex-wrap: wrap;
      padding: 10px;
      span{
        display: block;
        width: 100%;
        color: #a4a4a4;
        text-align: left;
      }
      input{
        width: 100%;
        border: none;
        outline: none;
        background-color: #fdfdfd;
      }
    }
}
.buybtn{
  text-align: center;
  color: white;
  height: 60px;
  line-height: 60px;
  font-size: 20px;
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%,0px);
  width: 90%;
  border-radius: 10px;
  background: #06070d;
}
  </style>
